<%--
 *  File:    PageConfigSummary.jsp
 *  @Author: banshang	
 *  Date:    2010/6/25
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.PageConfigSummary");
  String strModuleName = "IMG";
  String strTableName = "v_pageconfig";
  String privilegeCode = "ZB0107";
  String contextPath = request.getContextPath();

%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<%@include file="/inc/Print.inc"%>
<html>
<head>
<title>PageConfigSummary</title>
<PageFlow:CheckPageFlow pageName="p_pageconfig"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath %>/css/cn/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/css/cn/script.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%
	Vector pageConfigs = (Vector)pageContext.getAttribute("pageconfigs");
	if(pageConfigs == null) pageConfigs = new Vector();
%>
<script>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  editform.action = "PageConfigSummary.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();  
}
function clickRow(id)
{
  document.cform.pageconfigid.value = id;
}

function page_delete()
{
  var id = document.cform.pageconfigid.value;
  if(id == null || id.length == 0 || id == "" || id == "-1")
    return; 
  if(!confirm("<%= message.getMessageDesc("ARE_YOU_SURE_DEL")%>")) return;
  document.cform.actionname.value = "delete";
  isRunning = true;
  document.cform.submit();
}
function page_new(){
	self.location.href="PageConfigEditFrm.jsp?<%= OvalTools.randomURL() %>";
}
function page_edit(){
	var pageconfigid = document.cform.pageconfigid.value;
	if(pageconfigid == null) return; 
	self.location.href="PageConfigEditFrm.jsp?<%= OvalTools.randomURL() %>&pageconfigid="+pageconfigid;
}
function page_info(pageconfigid){
	self.location.href="PageConfigInfoFrm.jsp?<%= OvalTools.randomURL() %>&pageconfigid="+pageconfigid;
}
</script>

</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" cellspacing="0" cellpadding="0" border="0">
<form name="cform" method="post" action="<%=contextPath %>/Dispatcher">
		    <input type="hidden" name="pagename" value="p_pageconfig">
		    <input type="hidden" name="actionname">
		    <input type="hidden" name="IsEdit">

	  		<input type="hidden" name="value">
  	    <custom:hidden name="orginfo" property="orgid"/>
	      <custom:hidden name="orginfo" property="orgcode"/>
	      <custom:hidden name="orginfo" property="orgname"/>

<table width="100%" cellspacing="0">
  <% //--------------------------------------  page location --%>
	<%@ include file="/inc/PageLocation.inc" %>
</table>
	<table>
		<tr>
			<%@ include file="/inc/SummarySearch.inc" %>
		</tr>
	</table>
      <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="0" width="100%">


          <tr class="deepblue-left">
            <td width="22" class="title_center" >&nbsp;</td>
            <td width="80" class="title_center" ><a href="javascript:page_summary('orderby','pageconfigcode')"><%= label.getLabelName("L_PageConfig") + label.getLabelName("L_Code") %></a></td>
            <td class="title_center"><a href="javascript:page_summary('orderby','pageconfigname')"><%= label.getLabelName("L_PageConfig") + label.getLabelName("L_Name") %></a></td>
            <td width="100" class="title_center"><a href="javascript:page_summary('orderby','summaryidentify')"><%= label.getLabelName("L_PageConfig") + label.getLabelName("L_Identify") %></a></td>
            <td width="100" class="title_center"><a href="javascript:page_summary('orderby','vtable')">vtable<%= label.getLabelName("L_Name") %></a></td>
            <td width="80" class="title_center" ><a href="javascript:page_summary('orderby','selectmode')"><%= label.getLabelName("L_SelectMode") %></a></td>
			<td width="300" class="title_center"><%= label.getLabelName("L_Comment") %></td>
          </tr>
          <%
             int j = 0;
             String strClassType = new String();
             String strIsChecked = "";
             Integer defaultId = new Integer(-1);
             boolean bHasChecked = false;
            
          %>
          <logic:iterate id="pageconfig" collection="<%= pageConfigs %>">
          	<%
            HashMap pageConfig = (HashMap)pageContext.getAttribute("pageconfig");
            if(j%2 == 1){
              strClassType = "td-listrom";
            }else{
              strClassType = "";
            }

           if(!bHasChecked)
            {
              strIsChecked = "Checked";
              defaultId = (Integer)pageConfig.get("pageconfigid");
              bHasChecked = true;
              
            }else{
           		strIsChecked = "";
            }
            j++;
          %>
          	<tr onmouseover="this.className='tr-over'" onmouseout="this.className='<%=JspHelper.filterNull(strClassType)%>'" class="<%=JspHelper.filterNull(strClassType)%>"
          		onclick="javascript:radiotrue('radio<%=JspHelper.filterNull(j )%>');clickRow('<custom:write name="pageconfig" property="pageconfigid" nbsp="true"/>')"
          		>
	            <td width="5%">
	              <input class="normalradio" id="radio<%=JspHelper.filterNull(j )%>" type="radio" name="checkdept" value="" <%=JspHelper.filterNull( strIsChecked)%>>
	            </td>
	            <td>
	            	<a href="javascript:page_info('<custom:write name="pageconfig" property="pageconfigid"/>');">
	            		<custom:write name="pageconfig" property="pageconfigcode"/>
	            	</a>
	            </td>
	            <td><custom:write name="pageconfig" property="pageconfigname" nbsp="true"/></td>
	            <td>&nbsp;<custom:write name="pageconfig" property="summaryidentify" nbsp="true"/></td>
	            <td>&nbsp;<custom:write dictType="VTable" name="pageconfig" property="vtable" nbsp="true"/></td>
	            <td>&nbsp;<custom:write dictType="SelectMode" name="pageconfig" property="selectmode" nbsp="true"/></td>
	            <td>&nbsp;<custom:write name="pageconfig" property="comments" nbsp="true"/></td>
	         </tr>
          </logic:iterate>
           
          
          <input type="hidden" name="pageconfigid" value="<%=JspHelper.filterNull( defaultId )%>">
          

    <% //--------------------------------------  flipping page --%>
    <%@ include file="/inc/SummaryAction.inc" %>
    <table width="100%">
        <tr> 
          <td class="summary_top"></td>
        </tr>
		<tr >
			<td class="td_center">
	            <a onclick="page_new()"><custom:button type="1" label="L_New" imgsrc="new.gif" border="0" style="width:60"/></a>
	            <a onclick="page_edit()"><custom:button type="1" label="L_Edit" imgsrc="edit.gif" border="0" style="width:60"/></a>
	            <a onclick="page_delete()"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
	          </td>
	          
		</tr>
	</table>	
   </table>
</form>
</table>

</body>
</html>


